package com.gzx.spring.db.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.alibaba.nacos.shaded.com.google.common.collect.Maps;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gzx.spring.db.entity.SysDictItem;
import com.gzx.spring.db.mapper.SysDictItemMapper;
import com.gzx.spring.db.service.SysDictItemService;

@Service
@DS("phone")
public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDictItem> implements SysDictItemService {

	@Override
	public Map<String, String> getCodeMap(String type) {
		Map<String, String> codeMap = Maps.newHashMap();
		QueryWrapper<SysDictItem> queryWrapper = new QueryWrapper<>();
		queryWrapper.eq("dict_code", "orderStatusLabel");
		List<SysDictItem> datas = this.list(queryWrapper);
		for (SysDictItem data : datas) {
			codeMap.put(data.getItemValue(), data.getItemText());
		}
		return codeMap;
	}
}
